<?php

namespace app\admin\controller\logAction;

use app\common\Common;
use app\sys\model\StaffActionLog;
use think\facade\Validate;
use think\Request;

class log extends Common
{
    public function loginLog(Request $request){
        $page = $request->param("page",0);
        $limit = $request->param("limit",10);
        $list = StaffActionLog::loginLog("login",$page,$limit);
        return successJson("success",$list);
    }

    public function actLog(Request $request){

        $data = $request->param();
        $validate = Validate::make([
            "staff_id|用户id" => "number",
        ]);
        $date = $request->param("date",[]);
        $page = $request->param("page",0);
        $limit = $request->param("limit",10);
        if (!$validate->check($data)) {
            return failedJson($validate->getError());
        }
        $list = StaffActionLog::ActLog("login",$date,$data,$page,$limit);
        return successJson("success",$list);
    }
}